package com.ruoyi.ylyx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ylyx.mapper.YlyxGameMapper;
import com.ruoyi.ylyx.domain.YlyxGame;
import com.ruoyi.ylyx.service.IYlyxGameService;
import com.ruoyi.common.core.text.Convert;

/**
 * 游戏档案Service业务层处理
 * 
 * @author yuexl
 * @date 2021-02-05
 */
@Service
public class YlyxGameServiceImpl implements IYlyxGameService 
{
    @Autowired
    private YlyxGameMapper ylyxGameMapper;

    /**
     * 查询游戏档案
     * 
     * @param id 游戏档案ID
     * @return 游戏档案
     */
    @Override
    public YlyxGame selectYlyxGameById(String id)
    {
        return ylyxGameMapper.selectYlyxGameById(id);
    }

    /**
     * 查询游戏档案列表
     * 
     * @param ylyxGame 游戏档案
     * @return 游戏档案
     */
    @Override
    public List<YlyxGame> selectYlyxGameList(YlyxGame ylyxGame)
    {
        return ylyxGameMapper.selectYlyxGameList(ylyxGame);
    }

    /**
     * 新增游戏档案
     * 
     * @param ylyxGame 游戏档案
     * @return 结果
     */
    @Override
    public int insertYlyxGame(YlyxGame ylyxGame)
    {
        ylyxGame.setId(IdWorker.getId());
        ylyxGame.setCreateTime(DateUtils.getNowDate());
        return ylyxGameMapper.insertYlyxGame(ylyxGame);
    }

    /**
     * 修改游戏档案
     * 
     * @param ylyxGame 游戏档案
     * @return 结果
     */
    @Override
    public int updateYlyxGame(YlyxGame ylyxGame)
    {
        ylyxGame.setUpdateTime(DateUtils.getNowDate());
        return ylyxGameMapper.updateYlyxGame(ylyxGame);
    }

    /**
     * 删除游戏档案对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYlyxGameByIds(String ids)
    {
        return ylyxGameMapper.deleteYlyxGameByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除游戏档案信息
     * 
     * @param id 游戏档案ID
     * @return 结果
     */
    @Override
    public int deleteYlyxGameById(String id)
    {
        return ylyxGameMapper.deleteYlyxGameById(id);
    }

    @Override
    public List<YlyxGame> selectYlyxGameListByGameType(String typeIds) {
        return ylyxGameMapper.selectYlyxGameListByGameType(Convert.toStrArray(typeIds));
    }
}
